<template>
  <div class="header">
    <scroller :on-refresh="refresh" class="headerscroller">
      <div
        v-for="(item, index) in list"
        :key="item.id"
        class="headerimg"
        v-show="temp == index"
      >
        <div>
          <img :src="item.mainImgUrl" alt="" />
        </div>

        <div v-for="item in item.list" :key="item.id">
          <p class="pone">{{ item.title }}</p>
          <div>
            <div class="phone">
              <div v-for="item in item.productList" :key="item.id">
                <img class="imgfla" :src="item.imgUrl" alt="" />
                <p>{{ item.title }}</p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </scroller>
  </div>
</template>

<script>
export default {
  created() {
    this.getIist();
  },
  data() {
    return {
      list: [],
      temp: 0,
      status: "all",
      orderList: [],
      page: 0,
      all_page: 1,
    };
  },

  methods: {
    refresh() {},
    getIndex(index) {
      this.temp = index;
    },
    async getIist() {
      const res = await this.$require({
        url: "/category/data",
        methods: "get",
      });
      if (res.status == 200) {
        this.list = res.data.data;
        //  this.list.push(res.data.data)
        // console.log(this.list);
      }
    },
  },
};
</script>
<style lang="scss" scoped>
.header{
  width: 250px;
  height: 900px;
  overflow: hidden;
}
.headerscroller {
  width: 0px !important;
  height: 900px;
}
::v-deep .header {
  .headerscroller{
    width: 100px;
  }
}
._v-container > ._v-content {
  width: 250px;
}
.pone {
  width: 250px;
  color: #000000;
  font-size: 17px;
  // padding: 20px 0px;
  // background-color: chocolate;
}
.phone {
  width: 255px;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  overflow: visible;
  div {
    width: 33%;
    height: 100%;
    img {
      width: 80px;
      height: 80px;
    }
    p {
      font-size: 15px;
      text-align: center;
    }
  }
}
</style>